import type { AddressItem } from '@/types/address'
import { defineStore } from 'pinia'
import { ref } from 'vue'

export const useAddressStore = defineStore('address', () => {
  // 从订单页面点击地址管理存储的地址信息
  const address = ref<AddressItem>()
  // 修改地址
  const updateAddress = (data: AddressItem) => {
    address.value = data
  }

  return {
    address,
    updateAddress
  }
})
